From ad701b958fef1b1513a23ebffdd783ebda75123e Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Fri, 27 Feb 2026 13:22:37 +0100 Subject: [PATCH] workspaceAnimation: Assign movingWindow before creating window actors The BaseWorkspaceGroup constructor calls _createWindows(), which uses _shouldShowWindow() to determine which actors to create for the animation. In WorkspaceGroup _shouldShowWindow() this depends on a comparison with this._movingWindow, which however only gets set after the BaseWorkspaceGroup constructor has been called. This was causing the moving window to no longer stick to the screen when moved between workspaces. Fixes: 96be47933 ("workspaceAnimation: Split out BaseWorkspaceGroup") Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8992 Part-of: (cherry picked from commit 45fb9698a5a99ef9af7dc2155d6b6766818d5197) --- js/ui/workspaceAnimation.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/ui/workspaceAnimation.js b/js/ui/workspaceAnimation.js index 7debd5ad4..06c599728 100644 --- a/js/ui/workspaceAnimation.js +++ b/js/ui/workspaceAnimation.js @@ -16,7 +16,7 @@ export const WORKSPACE_SPACING = 100; export const BaseWorkspaceGroup = GObject.registerClass( class BaseWorkspaceGroup extends Clutter.Actor { - constructor(workspace, monitor) { + constructor(workspace, monitor, movingWindow) { super({ width: monitor.width, height: monitor.height, @@ -25,6 +25,7 @@ class BaseWorkspaceGroup extends Clutter.Actor { this._workspace = workspace; this._monitor = monitor; + this._movingWindow = movingWindow; this._windowRecords = []; this._createBackground(); @@ -94,9 +95,7 @@ class BaseWorkspaceGroup extends Clutter.Actor { export const WorkspaceGroup = GObject.registerClass( class WorkspaceGroup extends BaseWorkspaceGroup { constructor(workspace, monitor, movingWindow) { - super(workspace, monitor); - - this._movingWindow = movingWindow; + super(workspace, monitor, movingWindow); global.display.connectObject('restacked', () => this._syncStacking(), this); @@ -150,6 +149,10 @@ class WorkspaceGroup extends BaseWorkspaceGroup { export const WorkspaceBackground = GObject.registerClass( class WorkspaceBackground extends BaseWorkspaceGroup { + constructor(workspace, monitor) { + super(workspace, monitor, null); + } + _shouldShowWindow(window) { return this._isDesktopWindow(window) && this._windowIsOnThisMonitor(window); -- 2.39.5